package com.test.daily.leetcode.y2022.m06.day0625.v02;

import com.test.daily.leetcode.y2022.m06.day0606.v01.Soultion;

/**
 * @author Tom on 2022/6/25
 */
public class Solution {
    public static void main(String[] args) {
        String s = "l|*e*et|c**o|*de|";
        countAsterisks(s);
    }
    public static int countAsterisks(String s) {
        int index = 0;
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            if((index == 0) &&(s.charAt(i) == '|')){
                ++index;
            } else if((index == 1) &&(s.charAt(i) == '|') ){
                --index;
            }else if((index == 0) && (s.charAt(i) == '*')){
                count++;
            }
        }
        return count;
    }
}
